Skip to content

ci: harden workflow (split jobs, caching, windows leg, audit) - #60

Merged
Wintersta7e merged 2 commits into
mainfrom
ci/harden-workflow
May 31, 2026
Merged

ci: harden workflow (split jobs, caching, windows leg, audit)#60
Wintersta7e merged 2 commits into
mainfrom
ci/harden-workflow

Conversation

@Wintersta7e

Copy link
Copy Markdown
Owner

Summary

Rework the single ubuntu build-and-test job into a stronger, parallel pipeline.

Baseline hardening

  • concurrency with cancel-in-progress — stale runs no longer pile up
  • permissions: contents: read — least-privilege token
  • Per-job timeout-minutes
  • NuGet package caching keyed on csproj + Directory.Build.props
  • Tests run in Release against the existing build (--no-build), dropping the redundant Debug recompile

New jobs

  • format — split out so style fails fast
  • build-and-test-windows — mirrors the ubuntu job on the actual release target (win-x64)
  • dependency-audit — fails on vulnerable packages, reports deprecated ones

Notes

  • The build-and-test job name is preserved, so the existing required status check keeps reporting — no branch-protection change needed. The new jobs appear as additional checks you can promote to required whenever you like.
  • The audit allowlists Tmds.DBus.Protocol (Linux-only, transitive via Avalonia, already suppressed in Directory.Build.props) so it gates on new advisories only.
  • Opened as a PR so the rewritten workflow runs on itself before becoming the gate.

Split into format / build-and-test / build-and-test-windows /
dependency-audit jobs. Add concurrency cancel, least-priv permissions,
per-job timeouts, and NuGet caching. Tests now run in Release against
the existing build (no Debug recompile). Windows leg covers the win-x64
release target; audit fails on vulnerable packages except the already
accepted (and suppressed) Tmds.DBus.Protocol advisory.

The build-and-test job name is preserved so the required status check
keeps reporting without any branch-protection change.

Co-Authored-By: Rooty
The Windows CI leg surfaced three tests baking in Unix path strings:
- AppSettings roundtrip used a non-fully-qualified path that Validate()
  correctly prunes on Windows; use a temp-rooted (fully qualified) path
- two dry-run rename tests hardcoded the expected directory with forward
  slashes; derive it via Path.GetDirectoryName to match the node output

Production code was correct in all three; only the tests assumed Unix.

Co-Authored-By: Rooty
@Wintersta7e
Wintersta7e merged commit 1246ea7 into main May 31, 2026
4 checks passed
@Wintersta7e
Wintersta7e deleted the ci/harden-workflow branch May 31, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant